package com.googlecode.auctionx.mercadolivre;

import java.util.ArrayList;
import java.util.Collection;

import com.googlecode.auctionx.Order;
import com.googlecode.auctionx.Restriction;
import com.googlecode.auctionx.Search;
import com.googlecode.auctionx.beans.Auction;

public class MercadoLivreSearch implements Search {
	private Collection<Restriction> restrictions = new ArrayList<Restriction>();
	private String word;

	@Override
	public Collection<Restriction> getRestrictions() {
		return restrictions;
	}

	@Override
	public Search addOrder(Order order	) {
		return this;
	}

	@Override
	public Search addRestriction(Restriction restriction) {
		restrictions.add(restriction);
		return this;
	}

	@Override
	public Collection<Auction> search(String word) {
		this.word = word;
		return new MercadoLivre().search(this);
	}

	@Override
	public String getSearch() {
		return this.word;
	}
	
}